#ifndef DATAHANDLER_H
#define DATAHANDLER_H

#include <QObject>
#include <QVector>
#include "aprs_parser.h"

class DataHandler : public QObject
{
    Q_OBJECT

public:
    DataHandler();
    bool ConnectToDB();
    void StoreData(QString);
    QString dbName;
    QString hostName;
    QString userName;
    QString password;
    int portNumber;
    bool sqliteType;
    int clearTime;
    int purgeTime;
    QString clearUnit;
    QString purgeUnit;

private:
    void CreateTables();
    bool DuplicatePacket(APRSParser *parser);
    void Initialize();

signals:
    void StationClear(QString callsign);
    void StationPlot(QString callsign, char symbolTable, char symbolCode, float lat, float lon);
    //void StationUpdate(QString callsign, char symbolTable, char symbolCode, float lat_new, float lon_new);

private slots:
    void CheckTimes();
};

#endif // DATAHANDLER_H
